<?php include('./classes/statusOfCr.php'); ?>


<?php
class mailer {

//CR details..
public $id;
public $title;
public $status;

//mailing address details...
public $to;
//public $cc = array();

//Content details..
public $subject;
public $body;
public $headers ;


public function set_id($new_id) {
$this->id = $new_id;
}

public function set_title($new_title) {
$this->title = $new_title;
}

public function set_status($new_status) {
$this->status = $new_status;
}

public function set_to($new_to) {
$this->to = $new_to;

}

//public function set_cc($array_cc , $number_of_mail_addresses) {
//$dummy = $array_cc;             //copy array of mail addresses to dummy array...

//for($i=0;$i<$number_of_mail_addresses;$i++)
//{
//$headers = $headers.$dummy[$i];
//if($i!=$number_of_mail_addresses-1) 
//$headers = $headers.' , ';        
//}

//}

public function set_subject($new_subject) {
$this->subject = $new_subject;
}

public function set_body($new_body) {
$this->body = $new_body;
}

public function set_headers($new_headers) {
$this->headers = $new_headers;
}

//Getter Methods
public function get_id() {
return $this->id;
}

public function get_title() {
return $this->title;
}

public function get_status() {
return $this->status;
}

public function get_to() {
return $this->to;
}

//public function get_cc() {
//return $this->cc;
//}

public function get_subject() {
return $this->subject;
}

public function get_body() {
return $this->body;
}

public function get_headers() {
return $this->headers;
}


public function sendmail(){
if( mail($this->to,$this->subject , $this->body , $this->headers))
echo "";
else
echo "Sorry , An error occured while performing the operation";
}

}

?>